' QeForm    - Extension of QForm with elliptic edges
' creates an elliptic shpe inside the X1,Y1,X2,Y2 rectangle

     $APPTYPE GUI
     $INCLUDE "RAPIDQ.INC"

     DECLARE FUNCTION SetWindowRgn LIB "user32" ALIAS "SetWindowRgn" (hwnd AS LONG, hRgn AS LONG, bRedraw AS LONG) AS LONG
     DECLARE FUNCTION DeleteObject LIB "gdi32" ALIAS "DeleteObject" (hObject AS LONG) AS LONG
     DECLARE FUNCTION CreateEllipticRgn LIB "gdi32" ALIAS "CreateEllipticRgn" (X1 AS LONG, Y1 AS LONG, X2 AS LONG, Y2 AS LONG) AS LONG

	DECLARE FUNCTION CreateRoundRectRgn LIB "gdi32" ALIAS "CreateRoundRectRgn" (nLeftRect AS LONG, nTopRect AS LONG, nRightRect AS LONG, nBottomRect AS LONG, nWidthEllipse AS LONG, nHeightEllipse AS LONG) AS LONG

     TYPE QeForm EXTENDS QFORM
      QeRegion AS LONG
      EVENT OnShow
       WITH QeForm
        'QeRegion=CreateEllipticRgn(0,0,.Width,.Height)
        QeRegion = CreateRoundRectRgn (100,100,100,100,10,10)
        SetWindowRgn .handle,QeRegion,True
       END WITH
      END EVENT
      EVENT OnClose
       DeleteObject QeRegion
      END EVENT

     END TYPE


' Test QeForm component

     CREATE Form AS QeForm
      BorderStyle=bsDialog
      CAPTION="   QForm with rounded edges"
      SHOWMODAL
     END CREATE
